﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Web.Mvc;

namespace Background.Core.Events
{
    /// <summary>
    /// 登陆事件
    /// </summary>
    public class LogOnEvent
    {

        /// <summary>
        /// 登陆后的事件
        /// </summary>
        public event Action LogOnAfter;
        /// <summary>
        /// 登陆后的事件，返回ActionResult
        /// </summary>
        public event Func<ActionResult> LogOnAfterFunc;

        /// <summary>
        /// 触发RegisterAfter事件(在本程序集中去触发）
        /// </summary>
        internal void OnLogOnAfter()
        {
            if (LogOnAfter != null)
            {
                LogOnAfter();
            }
        }
        /// <summary>
        /// 触发LogOnAfterFunc事件，返回ActionResult对象
        /// </summary>
        /// <returns></returns>
        internal ActionResult OnLogOnAfterFunc()
        {
            if (LogOnAfterFunc != null)
            {
                return LogOnAfterFunc();
            }
            return null;
        }

    }
}
